///\todo upgrade

//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//  This file is part of the buola project (https://code.google.com/p/buola/).  //
//                                                                              //
//  Copyright(c) 2007-2012 Xavi Gratal                                          //
//  gratal AT gmail DOT com                                                     //
//                                                                              //
//  Buola is free software: you can redistribute it and/or modify               //
//  it under the terms of the GNU General Public License as published by        //
//  the Free Software Foundation, either version 3 of the License, or           //
//  (at your option) any later version.                                         //
//                                                                              //
//  Buola is distributed in the hope that it will be useful,                    //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of              //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               //
//  GNU General Public License for more details.                                //
//                                                                              //
//  You should have received a copy of the GNU General Public License           //
//  along with buola.  If not, see <http://www.gnu.org/licenses/>.              //
//                                                                              //
//////////////////////////////////////////////////////////////////////////////////

#ifndef _BUOLA_BBOX_PROTOCOL_ENUMS_H_
#define _BUOLA_BBOX_PROTOCOL_ENUMS_H_

namespace buola { namespace bbox { namespace protocol {

enum class EOpcode : uint16_t
{
    // core protocol entries
    REPLY,                  ///< opcode for replies
    ERROR,                  ///< error reply
    HELLO,                  ///< used to establish connection
    BYE,                    ///< terminate the connection

    //client to daemon
    GETSERVICE,             ///< looks for a service by address
    REGISTERSERVICE,        ///< sent by client to register a new service
    UNREGISTERSERVICE,      ///< sent by client to unregister a new service
    CONNECTTOCLIENT,        ///< asks the daemon to connect us to another client

    //daemon to client
    CLIENTCONNECTION,       ///< sent by daemon when another client wants to connect to us
    
    //client to client connection
    CALLMETHOD,             ///< call a method on a remote service
    CONNECTTERMINAL,        ///< connect to a terminal on a remote service
    INTROSPECT,             ///< get introspection data for a remote service
    LINKDATA,               ///< used to send chunks of data or notifications over a network
// 
//     //daemon to daemon
//     BINDPEER             //!< binds a connection between two daemons to a peer
};

enum class EError
{
    ADDRESS_IN_USE,
    SERVICE_NOT_FOUND,
    CLIENT_NOT_FOUND,
    METHOD_NOT_FOUND,
    TERMINAL_NOT_FOUND
};

/*namespace protocol*/ } /*namespace bbox*/ } /*namespace buola*/ }

#endif
